package com.zzyl.controller;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.dto.AlertDataHandleDto;
import com.zzyl.dto.AlertDataPageQueryDto;
import com.zzyl.service.AlertDataService;
import com.zzyl.vo.AlertDataVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description AlertDataController
 * @Author 聆听
 * @Date 2025-09-15
 */
@RestController
@RequestMapping("/alert-data")
@Api(tags = "报警数据")
public class AlertDataController extends BaseController {
    @Autowired
    private AlertDataService alertDataService;

    @GetMapping("/pageQuery")
    @ApiOperation(value = "分页查询报警数据")
    public ResponseResult<PageResponse<AlertDataVo>> FindByPage(AlertDataPageQueryDto alertDataPageQueryDto) {

        return success(alertDataService.FindByPage(alertDataPageQueryDto));
    }

    @PutMapping("/handleAlertData/{id}")
    @ApiOperation(value = "处理报警数据")
    public ResponseResult updateAlertData(@PathVariable("id") Long id, @RequestBody AlertDataHandleDto alertDataHandleDto) {
        alertDataService.updateAlertData(id, alertDataHandleDto);

        return success();
    }

}
